from django.urls import path
from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView
from rest_framework import routers

from apps.system.views import index, home, login, role, user, permission, files, images, schedules

urlpatterns = [
    path('index/', index.index, name='index'),
    path('login/', login.LoginView.as_view(), name='login'),
    path('logout/', login.LogoutView.as_view(), name='session_logout'),
    path('refresh/', TokenRefreshView.as_view(), name='token_refresh'),
    path('verify/', TokenVerifyView.as_view(), name='token_verify'),
    path('roleList/', role.RoleListView.as_view(), name='role_list'),
    path('userInfo/', user.InfoView.as_view(), name='user_Info'),
    path('task/', schedules.TaskList.as_view(), name='task'),
    path('server/', home.ServerView.as_view(), name='server'),

]

route = routers.SimpleRouter()
route.register('user', user.UserView)
urlpatterns += route.urls

route = routers.SimpleRouter()
route.register('role', role.RoleView)
urlpatterns += route.urls

route = routers.SimpleRouter()
route.register('permission', permission.PermissionView)
urlpatterns += route.urls

route = routers.SimpleRouter()
route.register('files', files.FilesView)
urlpatterns += route.urls

route = routers.SimpleRouter()
route.register('images', images.ImagesView)
urlpatterns += route.urls

route = routers.SimpleRouter()
route.register('tasks', schedules.TaskView)
urlpatterns += route.urls
